package com.cysion.study.ui

import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.cysion.study.ktbox.base.BaseActivity
import com.cysion.study.ktbox.image.RoundTransform
import com.cysion.study.ktbox.utils.whiteTextTheme
import com.cysion.other.color
import com.cysion.study.uibox.bar.TopBar
import com.cysion.study.R
import com.cysion.study.entity.ManagesEntity
import kotlinx.android.synthetic.main.activity_prview.*

class PrviewActivity : BaseActivity() {
    override fun getLayoutId(): Int = R.layout.activity_prview

    var obj: ManagesEntity? = null

    override fun initView() {
        whiteTextTheme(color(R.color.main_cl))
        topbar.apply {
            setTitle("信息预览")
            setOnTopBarClickListener { obj, pos ->
                if (pos == TopBar.Pos.LEFT) {
                    finish()
                }
            }
        }

        obj = intent.getBundleExtra("key").getSerializable("obj") as ManagesEntity?
        Glide.with(this).load("")
            .apply(RequestOptions.placeholderOf(R.mipmap.place_holder))
            .apply(RequestOptions.bitmapTransform(RoundTransform(2)))
            .into(iv_head)
        tv_name.text=obj?.tname
        rb_bar.rating= obj?.level?.toFloat()!!
        tv_price.text = "￥" + obj?.money + obj?.units
        tv_tag1.text = obj?.oneCategoryName + "  " + obj?.twoCategoryName
        tv_tag2.text = "范围：" + obj?.type
        tv_area.text = obj?.province + obj?.city + obj?.county
        tv_content.text=obj?.content//授课内容
        tv_info.text=obj?.content//简介
        tv_jl.text=obj?.content//经历


    }

    override fun closeMvp() {
    }

}
